<template>
  <div>
    <span>子组件:</span>
    <!-- <div>
      <span>父组件传过来的字符串值：{{message}}</span>
    </div> -->

    <div>
      <!-- <span>父组件传过来的对象值：{{sonMsgObject.passport}}</span> -->
      <el-button type="primary" @click="set()">添加</el-button>
    </div>

  </div>
</template>

<script>
export default {
  data () {
    return {

      sonName: '片言son',
      message: this.msg,

      sonMsgObject: this.msgObject

    }
  },

  //接收数据
  //   props: ["msgObject"],
  props: {
    msgObject: Object,
  },

  methods: {
    getName () {
      return this.sonName
    },

    set () {
      this.sonName = this.sonName + '1'
      this.$emit('setMsg', this.sonName)


    }
  }

}
</script>

<style scoped>
</style>